<!DOCTYPE html>
<html lang="en" style="background:#fff;">
<head>
    <base href="${basePath}">
    <#include "common/top.html"/>
</head>
<body style="background:#fff;overflow: hidden">
<form class="layui-form" modelAttribute="monitorUnderParameter" name="form1" id="form1" method="post">
    <div class="layui-form-item-dept">

        <input name="comid" name="comid" value="${monitorUnderParameter.comid}" type="hidden">

        <div class="layui-form-item">
            <label class="layui-form-label">串口号：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="comid" id="comid"
                       value="${monitorUnderParameter.comid}" maxlength="50"
                       placeholder="这里输入串口号，" title="串口号"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">UDP接收端口号：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="udpport" id="udpport"
                       value="${monitorUnderParameter.udpport}" maxlength="50"
                       placeholder="这里输入UDP接收端口号" title="UDP接收端口号"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">通讯方式：</label>
            <div class="layui-input-inline">
                <select name="contact" id="contact" lay-filter="contact">
                    <option value="1">混合方式</option>
                    <option value="2">单一串口</option>
                </select>
            </div>
        </div>

    </div>
</form>
</body>
<script type="text/javascript">

    layui.use(['form', 'table', 'laydate'], function () {
        var form = layui.form;
        var laydate = layui.laydate;

        $("#contact  option").each(function () {
            if ($(this).val() == "${monitorUnderParameter.contact}") {
                $(this).attr("selected", true)
            }
        });
        form.render();

    });


    function submitHandler() {
        var prefix = basePath + "facilities/underdata";

        $.operate.post(prefix + '/updateMonitorUnderParameter', $("#form1").serializeArray(), function (result) {
            if (result.status == true) {
                layer.alert(result.msg, function (index) {
                    var index1 = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index1);
                    layer.close(index);
                });
            } else {
                parent.layer.alert(result.msg);
            }
        });
    }
</script>
</body>
</html>
